import {defineStore} from "pinia";
import {ref, watch} from "vue";
import {Store} from "../utils/store";

export const useSettingStore = defineStore('settings', () => {
  const store = new Store('app');

  const cvsPath = ref<string>('');

  (async () => {
    cvsPath.value = await store.get('cvs_path', '')
  })();

  watch(cvsPath, async (newPath) => {
    await store.set('cvs_path', newPath)
  })

  return {
    cvsPath,
  }
})